import request from "@/utils/request";

// 查询可视化大屏数据
export function getScreen(query: any) {
  if (typeof query === "object" && query !== null) {
    return request({
      url: `/screen`,
      method: "get",
      params: query
    });
  } else {
    return request({
      url: `/screen/${query}`,
      method: "get"
    });
  }
}

// 新增可视化大屏
export function addScreen(data: any) {
  return request({
    url: "/api/screen",
    method: "post",
    data: data
  });
}

// 修改可视化大屏
export function updateScreen(filter: any, data: any) {
  return request({
    url: `/screen/${filter}`,
    method: "put",
    data: data
  });
}

// 删除可视化大屏
export function delScreen(id: any) {
  const pk = Array.isArray(id) ? id : [id];
  return request({
    url: "/api/screen",
    method: "delete",
    params: {
      id: pk
    }
  });
}
